﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:Get ID="Module" Object="Module" Operation="Get(Request.QueryString['Namespace'])" />
<ali:Get ID="Object" Object="Module.Object" Operation="Get(Request.QueryString['Namespace'], Convert.ToInt32(Request.QueryString['ObjectID']))" />
<ali:Get ID="Property" Object="Module.Object.Property" Operation="Get(Request.QueryString['Namespace'], Convert.ToInt32(Request.QueryString['ObjectID']), Convert.ToInt32(Request.QueryString['ID']))" Validate="True" />
<section data-page="module_object_property_edit" data-title="编辑属性" data-lang="<%=ContentLang%>" data-namespace="<%=Module[Namespace]%>" data-object-id="<%=Request.QueryString["ObjectID"]%>" data-id="<%=Request.QueryString["ID"]%>" data-sql-db-type="<%=Property[SqlDbType]%>" data-ole-db-type="<%=Property[OleDbType]%>" data-main-field-id="<%=Property[MainFieldID]%>">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="../../list.aspx" target="ali-navtab">模块列表</a> → <a href="../list.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>" target="ali-navtab"><b class="<%=ContentLang%>Font"><%=Module[Label]%></b>模块的对象列表</a> → <b class="<%=ContentLang%>Font"><%=Object[Label]%></b></dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<form action="" class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li><a href="../edit.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ID=<%=Request.QueryString["ObjectID"]%>" target="ali-navtab">编辑</a></li>
							<li><a href="../operation/list.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ObjectID=<%=Request.QueryString["ObjectID"]%>" target="ali-navtab">操作列表</a></li>
							<li><a href="../operation/add.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ObjectID=<%=Request.QueryString["ObjectID"]%>" target="ali-navtab">添加操作</a></li>
							<li><a href="list.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ObjectID=<%=Request.QueryString["ObjectID"]%>" target="ali-navtab">属性列表</a></li>
							<li><a href="add.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ObjectID=<%=Request.QueryString["ObjectID"]%>" target="ali-navtab">添加属性</a></li>
							<li class="ali-active"><a>编辑属性</a></li>
						</ul>				
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel">
						<table class="post-table margin2">
							<tr>
								<th>名称：</th>
								<td><input type="text" name="Name" value="<%=Property[Name]%>" size="30" maxlength="50" class="ali-input <%=ContentLang%>Font"> Guid：<%=Property[ID]%></td>
							</tr>
							<tr>
								<th>字段名称：</th>
								<td><input type="text" name="FieldName" value="<%=Property[FieldName]%>" size="30" maxlength="50" class="ali-input">（对应的表字段。可以空）</td>
							</tr>
							<tr>
								<th>必填字段：</th>
								<td>
									<%If !Convert.ToBoolean(Property[IsNullable])%>
										<label><input type="radio" name="IsNullable" value="false" checked>是</label>
										<label><input type="radio" name="IsNullable" value="true">否</label>
									<%Else%>
										<label><input type="radio" name="IsNullable" value="false">是</label>
										<label><input type="radio" name="IsNullable" value="true" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>SqlServer默认值：</th>
								<td><input type="text" name="SqlDbDefault" value="<%=Property[SqlDbDefault]%>" maxlength="50" class="ali-input"></td>
							</tr>
							<tr>
								<th>OleDb默认值：</th>
								<td><input type="text" name="OleDbDefault" value="<%=Property[OleDbDefault]%>" maxlength="50" class="ali-input"></td>
							</tr>
							<tr>
								<th>SqlServer类型：</th>
								<td>
									<select name="SqlDbType" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
										<option value="20">TinyInt</option>
										<option value="16">SmallInt</option>
										<option value="8">Int</option>
										<option value="0">BigInt</option>
										<option value="12">NVarChar</option>
										<option value="22">VarChar</option>
										<option value="10">NChar</option>
										<option value="3">Char</option>
										<option value="11">NText</option>
										<option value="2">Bit</option>
										<option value="4">DateTime</option>
										<option value="9">Money</option>
										<option value="5">Decimal</option>
										<option value="14" selected="selected">UniqueIdentifier</option>
									</select>
								</td>
							</tr>
							<tr>
								<th>OleDb类型：</th>
								<td>
									<select name="OleDbType" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
										<option value="16">TinyInt</option>
										<option value="2">SmallInt</option>
										<option value="3">Integer</option>
										<option value="20">BigInt</option>
										<option value="202">VarWChar</option>
										<option value="200">VarChar</option>
										<option value="130">WChar</option>
										<option value="129">Char</option>
										<option value="203">LongVarWChar</option>
										<option value="11">Boolean</option>
										<option value="7">Date</option>
										<option value="6">Currency</option>
										<option value="131">Numeric</option>
										<option value="72" selected="selected">Guid</option>
									</select>
								</td>
							</tr>
							<tr>
								<th>字段大小：</th>
								<td><input type="text" name="MaxLength" value="<%=Property[MaxLength]%>" size="5" maxlength="10" class="ali-input"></td>
							</tr>
							<tr>
								<th>精度：</th>
								<td><input type="text" name="NumericPrecision" value="<%=Property[NumericPrecision]%>" size="5" maxlength="10" class="ali-input"></td>
							</tr>
							<tr>
								<th>小数位数：</th>
								<td><input type="text" name="NumericScale" value="<%=Property[NumericScale]%>" size="5" maxlength="10" class="ali-input"></td>
							</tr>
							<tr>
								<th>自动编号：</th>
								<td>
									<%If Convert.ToBoolean(Property[IsIdentity])%>
										<label><input type="radio" name="IsIdentity" value="true" checked>是</label>
										<label><input type="radio" name="IsIdentity" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="IsIdentity" value="true">是</label>
										<label><input type="radio" name="IsIdentity" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>多语言字段：</th>
								<td>
									<%If Convert.ToBoolean(Property[MultiLanguage])%>
										<label><input type="radio" name="MultiLanguage" value="true" checked>是</label>
										<label><input type="radio" name="MultiLanguage" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="MultiLanguage" value="true">是</label>
										<label><input type="radio" name="MultiLanguage" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>主键：</th>
								<td>
									<%If Convert.ToBoolean(Property[PrimaryKey])%>
										<label><input type="radio" name="PrimaryKey" value="true" checked>是</label>
										<label><input type="radio" name="PrimaryKey" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="PrimaryKey" value="true">是</label>
										<label><input type="radio" name="PrimaryKey" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>唯一约束：</th>
								<td>
									<%If Convert.ToBoolean(Property[Unique])%>
										<label><input type="radio" name="Unique" value="true" checked>是</label>
										<label><input type="radio" name="Unique" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="Unique" value="true">是</label>
										<label><input type="radio" name="Unique" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>可做缺省Meta信息：</th>
								<td>
									<%If Convert.ToBoolean(Property[IsMeta])%>
										<label><input type="radio" name="IsMeta" value="true" checked>是</label>
										<label><input type="radio" name="IsMeta" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="IsMeta" value="true">是</label>
										<label><input type="radio" name="IsMeta" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>主表：</th>
								<td>
									<select name="MainTableID" data-class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="">
										<option value="00000000-0000-0000-0000-000000000000" data-item="" data-parent="">未指定</option>
										<ali:Tree Object="Module.Object" Condition="Namespace=Request.QueryString['Namespace']">
											<ali:Record>
												<%If Guid.Equals(ID, Property[MainTableID])%>
													<option value="<%=ID%>" data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" selected><%=Name%></option>
												<%Else%>
													<option value="<%=ID%>" data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>"><%=Name%></option>
												<%EndIf%>
												<%=ChildRecords%>
											</ali:Record>
										</ali:Tree>
									</select>
								</td>
							</tr>
							<tr>
								<th>主键：</th>
								<td><select name="MainFieldID" data-class="<%=ContentLang%>Font" data-ali-widget="combo"></select></td>
							</tr>
							<tr>
								<th>级联更新相关字段：</th>
								<td>
									<%If Convert.ToBoolean(Property[UpdateRule])%>
										<label><input type="radio" name="UpdateRule" value="true" checked>是</label>
										<label><input type="radio" name="UpdateRule" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="UpdateRule" value="true">是</label>
										<label><input type="radio" name="UpdateRule" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>级联删除相关字段：</th>
								<td>
									<%If Convert.ToBoolean(Property[UpdateRule])%>
										<label><input type="radio" name="DeleteRule" value="true" checked>是</label>
										<label><input type="radio" name="DeleteRule" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="DeleteRule" value="true">是</label>
										<label><input type="radio" name="DeleteRule" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>备注：</th>
								<td><textarea rows="5" cols="60" name="Memo" class="ali-input"><%=HttpUtility.HtmlEncode(Convert.ToString(Property[Memo]))%></textarea></td>
							</tr>
						</table>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">保 存</button></div>
	</form>
</section>